package org.time;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyTimer {
	@Scheduled(cron = "0/6 * * * * *")   
    public void show(){  
        System.out.println("Annotation：is show run");  
    }  
      
    /**  
     * 心跳更新。启动时执行一次，之后每隔2秒执行一次  
     */    
    @Scheduled(fixedRate = 1000*2)   
    public void print(){  
        System.out.println("Annotation：print run");  
    }  
}
